home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / tex / lametex_.z / lametex_ / lametex / page / page_shake.ps < prev    next >
Encoding:
Text File  |  1992-09-02  |  2.3 KB  |  85 lines

  1. %! page_shake.ps    - A replica of the standard LaTeX page
  2. %% This is a LameTeX Page Description File written in PostScript.
  3. %% Postscript Code by Jon Monsarrat Copyright 1992
  4. %% permission given for anything except selling this or deleting the header.
  5. %% This is a page template for the LameTeX formatter
  6. %% A page with wavy margins for LameTeX output.
  7. %%%%%%%%%%%  icon-name  LeftMarginIcon   - %%%%%%%%%%%%
  8. % Given the name of an icon, executes the icon in the left margin.
  9. /LeftMarginIcon
  10. {
  11.   gsave
  12.        20 ypos 72 sub translate cvx exec
  13.   grestore
  14. } bind def
  15.  
  16. %% REQUIRED DEFINITIONS START HERE %%
  17.  
  18. %%%%%%%%%%%%%%%% PageShape %%%%%%%%%%%%%%%%%%%%%%
  19. % PageShape draws a wavy page, given margins.
  20. /PageShape
  21. {
  22.   4 dict begin
  23.   /bp 0 in def /lp -.5 in def /hp 11 in def /wp 9.5 in def
  24.   lp .5 in add bp moveto
  25.   wp .8 in sub 0 rlineto
  26.   1 1 4
  27.   {
  28.     pop
  29.     currentpoint hp 16 div add hp 16 div
  30.     270 90 arc
  31.     currentpoint hp 16 div add hp 16 div
  32.     270 90 arcn
  33.   } for
  34.   wp .8 in sub -1 mul 0 rlineto
  35.  
  36.   1 1 4
  37.   {
  38.     pop
  39.     currentpoint hp 16 div sub hp 16 div
  40.     90 270 arc
  41.     currentpoint hp 16 div sub hp 16 div
  42.     90 270 arcn
  43.   } for
  44.   end
  45.   closepath
  46.   currentflat 8 mul
  47. } bind def
  48.  
  49. % Anything to do when a new page is started
  50. /StartPage
  51. {
  52. } bind def
  53.  
  54. % Anything to do when a new page is ended
  55. /EndPage
  56. {
  57.    pagenumber 4 string cvs
  58.    dup stringwidth pop 8.5 in
  59.    formatdict /rightmargin get sub
  60.    formatdict /leftmargin get sub 
  61.    exch sub 2 div formatdict /leftmargin get add
  62.    formatdict /bottommargin get 2 div moveto show
  63.    /pagenumber pagenumber 1 add def
  64.    showpage  % A new page here really does mean start a new page.
  65. } bind def
  66.  
  67. %% INITIALIZATION TO DO WHEN FILE IS LOADED %%
  68. % Page-specific defaults that describe the page.
  69. /InitPage
  70. {
  71.   /evenodd true def   % if true use even-odd rule; false means winding rule
  72.   /fillout false def  % true means fill outside shape. false is inside.
  73.  
  74.   /in { 72 mul } def
  75.   /BM 0 in def    % Absolute Bottom Margin for page
  76.   /TM 11 in def   % Absolute Top Margin for page
  77.   /LM 0 in def    % Absolute Left Margin for page
  78.   /RM 8.5 in def  % Absolute Right Margin for page
  79.   
  80.   userdict /pagenumber known not
  81.   { /pagenumber 1 def } if    % Initialize pagenumber if not done already
  82. } bind def
  83.  
  84. InitPage        % Just loading this file initializes the page.
  85.